﻿using JXCBLL;
using JXCModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace JXCManagerUI.Controllers
{
    public class Sys_MenuController : Controller
    {

        public ActionResult LoadMenu()
        {
            return PartialView("_MenuPartialPage");
        }

        public ActionResult GetMenuById(int pId)
        {
            AuthorityBLL dal = new AuthorityBLL();

            List<Sys_Role_Menu> list = dal.GetMenuList(pId, 2);

            var query = list.Select(p => new
            {
                p.Sys_Menu.Id,
                p.Sys_Menu.MenuName,
                p.Sys_Menu.icon,
                p.Sys_Menu.Url
            });

            return Json(query, JsonRequestBehavior.AllowGet);
        }
    }
}